package com.javaclimb.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;

@Configuration
public class FileMvcConfig extends WebMvcConfig{

    //资源映射管理器
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        //前端用户头像地址
        registry.addResourceHandler("/avatarImg/**").addResourceLocations(
                "file:"+System.getProperty("user.dir")+System.getProperty("file.separator")+"avatarImg"+ System.getProperty("file.separator")
        );
    }
}
